package org.wangle.goods.service;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.stereotype.Component;
import org.wangle.api.goods.pojo.Goods;
import org.wangle.api.goods.provider.GoodsProvider;
import org.wangle.goods.mapper.GoodsMapper;

import javax.annotation.Resource;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author wangle
 * @since 2021-07-21
 */

@Service(protocol = "dubbo")
@Component
public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements GoodsProvider {

    @Resource
    private GoodsMapper goodsMapper;

    @Override
    public void decrementStock(Integer goodsId) {
        goodsMapper.decrementStock(goodsId);
    }

    @Override
    public void incrementStock(Integer goodsId) {
        goodsMapper.incrementStock(goodsId);
    }
}
